package com.bw.liuyushan.liuyushan20210929.Adapter;

import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;

import java.util.ArrayList;

/**
 * Liuyushan20210929
 * file name is : FragmentMainAdapter
 * created by Ender on 2021/9/29 15:25.
 * author : 刘雨杉
 * Describe:
 */
public class FragmentMainAdapter extends FragmentStatePagerAdapter {
    ArrayList<Fragment> fragments;

    public FragmentMainAdapter(@NonNull FragmentManager fm, ArrayList<Fragment> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {

    }
}
